<?php
include_once("keys.php");

function sendResetPasswordEmail($email,$link){
    require 'sendgrid/vendor/autoload.php';

    $from = new SendGrid\Email(null, "notification@freewheelshop.com");
    $subject = "Reset Password";
    $to = new SendGrid\Email(null, $email);
    $content = new SendGrid\Content("text/plain", "Please follow the link to reset your password ! ".$link."   .Thanks!");
    $mail = new SendGrid\Mail($from, $subject, $to, $content);

    error_log("sending link ".$link);

    $apiKey = getSendgridKey();
    $sg = new \SendGrid($apiKey);

    $sg->client->mail()->send()->post($mail);
}

